package by.grsu.samusev.page;


import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.link.Link;

import by.grsu.samusev.entity.Car;
import by.grsu.samusev.entity.Driver;
import by.grsu.samusev.entity.Request;
import by.grsu.samusev.entity.Voyage;
import by.grsu.samusev.page.pages.CarEditPage;
import by.grsu.samusev.page.pages.CarListPage;
import by.grsu.samusev.page.pages.DriverEditPage;
import by.grsu.samusev.page.pages.DriverListPage;
import by.grsu.samusev.page.pages.RequestEditPage;
import by.grsu.samusev.page.pages.RequestListPage;
import by.grsu.samusev.page.pages.VoyageEditPage;
import by.grsu.samusev.page.pages.VoyageListPage;



public class SamusevWebPage extends WebPage {
	public SamusevWebPage() {
		super();
		//cars
		add(new Link("createCar") {
			@Override
			public void onClick() {
				setResponsePage(new CarEditPage(new Car()));
			}
		});	
		add(new Link("listCars") {
			@Override
			public void onClick() {
				setResponsePage(new CarListPage());
			}
		});

		//drivers
		add(new Link("addDriver") {
			@Override
			public void onClick() {
				setResponsePage(new DriverEditPage(new Driver()));
			}
		});
		add(new Link("listDrivers") {
			@Override
			public void onClick() {
				setResponsePage(new DriverListPage());
			}
		});
		//Voyages
		add(new Link("createVoyage") {
			@Override
			public void onClick() {
				setResponsePage(new VoyageEditPage(new Voyage()));
			}
		});
	
		add(new Link("listVoyages") {
			@Override
			public void onClick() {
				setResponsePage(new VoyageListPage());
			}
		});
		//Requests
		add(new Link("createRequest") {
			@Override
			public void onClick() {
				setResponsePage(new RequestEditPage(new Request()));
			}
		});
	
		add(new Link("listTrains") {
			@Override
			public void onClick() {
				setResponsePage(new RequestListPage());
			}
		});

		 

	}
}